<?php

namespace Base\WebBundle\Twig;

use Base\WebBundle\Repository\MenuRepository;

class MenuExtension extends \Twig_Extension
{
	public function getMenus()
	{
		$em = $this->getDoctrine()->getManager();
		$menus = $em->getRepository('BaseWebBundle:Menu')->findAllOrderedByName();
		return $menus;
	}

	public function getName()
	{
		return 'menu_extension';
	}
}